package utils;

import domain.Access;
import org.apache.flink.api.common.functions.AggregateFunction;

/**
 * Create by zhh on 2022/9/16.
 * * @param <IN> The type of the values that are aggregated (input values)
 * * @param <ACC> The type of the accumulator (intermediate aggregate state).
 * * @param <OUT> The type of the aggregated result
 */
public class TopNAggregateFunction implements AggregateFunction<Access,Long,Long> {
    @Override
    public Long createAccumulator() {
        return 0L;
    }

    @Override
    public Long add(Access value, Long accumulator) {
        return accumulator+1;
    }

    @Override
    public Long getResult(Long accumulator) {
        return accumulator;
    }

    @Override
    public Long merge(Long a, Long b) {
        return null;
    }
}
